.TH GenTone 1audio "TSP (audio)"
.SH Routine
.in +4n
.ti -4n
GenTone [options] AFile
.in -4n
.SH Purpose
.in +4n
.ti -4n
Generate an audio file containing a sine wave
.in -4n
.SH Description
This program generates a sine wave of a given amplitude and phase.  The
samples of the sine wave are written to an audio file.  Options are available
to specify the number of samples, the sampling frequency and the data format
of the output file.
.SH Options
.in +4n
.ti -4n
Output file name: AFile:
.br
Specifying "-" as the output file indicates that output is to be written
to standard output.  If the output file type is not explicitly given (-F
option), the extension of the output file name is used to determine the
file type.
.ft CW
.nf
.ne 3
  ".au"   - AU audio file
  ".wav"  - WAVE file
  ".aif"  - AIFF sound file
  ".afc"  - AIFF-C sound file
  ".raw"  - Headerless file (native byte order)
  ".txt"  - Headerless file (text data)
.fi
.ft P
.ti -4n
-f FREQ, --frequency=FREQ
.br
Frequency of the sine wave in Hertz, default 1000.
.ti -4n
-r SDEV, --rms=SDEV
.br
Root-mean-square value of the sinusoid in normalized units, default
0.03. The rms value can be given as a real number (e.g., "0.03")
or as a ratio (e.g., "983.04/32768").
.ti -4n
-a AMPL, --amplitude_max=AMPL
.br
Maximum amplitude of the sine wave in normalized units.  The amplitude
of the sine wave is specified by either the rms value or the maximum
amplitude. The amplitude can be given as a real number (e.g., "0.0424")
or as a ratio (e.g., "1390.2/32768").
.ti -4n
-p PHASE, --phase PHASE
.br
Initial phase of the sinusoid (cosine) in degrees, default 0.  Zero
phase gives a cosine, -90 degrees gives a sine.
.ti -4n
-n NSAMPLE, --number_samples=NSAMPLE
.br
Number of output samples to be generated.
.ti -4n
-s SFREQ, --srate=SFREQ
.br
Sampling frequency for the output audio file, default 8000.
.ti -4n
-F FTYPE, --file_type=FTYPE
.br
Output file type.  If this option is not specified, the file type is
determined by the output file name extension.
.ft CW
.nf
.ne 3
  "AU" or "au"             - AU audio file
  "WAVE" or "wave"         - WAVE file
  "WAVE-NOEX" or "wave-noex" - WAVE file (no extensible data)
  "AIFF-C" "aiff-c"        - AIFF-C sound file
  "AIFF" or "aiff"         - AIFF sound file
  "noheader" or "noheader_native" - Headerless file (native byte
                             order)
  "noheader_swap"          - Headerless file (byte swapped)
  "noheader_big-endian"    - Headerless file (big-endian byte
                             order)
  "noheader_little-endian" - Headerless file (little-endian byte
                             order)
.fi
.ft P
.ti -4n
-D DFORMAT, --data_format=DFORMAT
.br
Data format for the output file, default integer16
.ft CW
.nf
.ne 3
  "mu-law8"   - 8-bit mu-law data
  "A-law8"    - 8-bit A-law data
  "unsigned8" - offset-binary 8-bit integer data
  "integer8"  - two's-complement 8-bit integer data
  "integer16" - two's-complement 16-bit integer data
  "integer24" - two's-complement 24-bit integer data
  "integer32" - two's-complement 32-bit integer data
  "float32"   - 32-bit floating-point data
  "float64"   - 64-bit floating-point data
  "text"      - text data
.fi
.ft P
The data formats available depend on the output file type.
AU audio files:
.ft CW
.nf
.ne 3
  mu-law, A-law, 8/16/24/32-bit integer, 32/64-bit float
.fi
.ft P
WAVE files:
.ft CW
.nf
.ne 3
  mu-law, A-law, offset-binary 8-bit integer, 16/24/32-bit integer,
  32/64-bit float
.fi
.ft P
AIFF-C sound files:
.ft CW
.nf
.ne 3
  mu-law, A-law, 8/16/24/32-bit integer, 32/64-bit float
.fi
.ft P
AIFF sound files:
.ft CW
.nf
.ne 3
  8/16/24/32-bit integer
.fi
.ft P
Headerless files:
.ft CW
.nf
.ne 3
  all data formats
.fi
.ft P
.ti -4n
-I INFO, --info=INFO
.br
Audio file information string for the output file.
.ti -4n
-h, --help
.br
Print a list of options and exit.
.ti -4n
-v, --version
.br
Print the version number and exit.
.in -4n
.PP
By default, the output file contains a standard audio file information
string.
.ft CW
.nf
.ne 3
  Standard Audio File Information:
     date: 1994-01-25 19:19:39 UTC    date
     program: GenTone                 program name
.fi
.ft P
This information can be changed with the header information string which is
specified as one of the command line options.  Structured information records
should adhere to the above format with a named field terminated by a colon,
followed by numeric data or text.  Comments can follow as unstructured
information.
.ft CW
.nf
.ne 3
  Record delimiter: Newline character or the two character escape
      sequence "\\" + "n".
  Line delimiter: Within records, lines are delimiteded by a carriage
      control character, the two character escape sequence "\\" + "r",
      or the two character sequence "\\" + newline.
.fi
.ft P
If the information string starts with a record delimiter, the header
information string is appended to the standard header information.  If not,
the user supplied header information string appears alone.
.SH Author / version
P. Kabal / v5r0a  2003-11-06
.SH See Also
AFsp
